import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ManHourVO, ManHourForm, ManHourQuery } from '@/api/basedata/manHour/types';

/**
 * 查询标准工时维护列表
 * @param query
 * @returns {*}
 */

export const listManHour = (query?: ManHourQuery): AxiosPromise<ManHourVO[]> => {
  return request({
    url: '/basedata/manHour/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询标准工时维护详细
 * @param id
 */
export const getManHour = (id: string | number): AxiosPromise<ManHourVO> => {
  return request({
    url: '/basedata/manHour/' + id,
    method: 'get'
  });
};

/**
 * 新增标准工时维护
 * @param data
 */
export const addManHour = (data: ManHourForm) => {
  return request({
    url: '/basedata/manHour',
    method: 'post',
    data: data
  });
};

/**
 * 修改标准工时维护
 * @param data
 */
export const updateManHour = (data: ManHourForm) => {
  return request({
    url: '/basedata/manHour',
    method: 'put',
    data: data
  });
};

/**
 * 删除标准工时维护
 * @param id
 */
export const delManHour = (id: string | number | Array<string | number>) => {
  return request({
    url: '/basedata/manHour/' + id,
    method: 'delete'
  });
};
